package o;

import android.content.ComponentName;
import android.content.Context;
import android.media.browse.MediaBrowser;
import android.media.browse.MediaBrowser.ConnectionCallback;
import android.media.browse.MediaBrowser.MediaItem;
import android.media.browse.MediaBrowser.SubscriptionCallback;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import java.util.List;

@RequiresApi(21)
public class q {

    public interface d {
        void ˊ();

        void ˋ();

        void ॱ();
    }

    public interface a {
        void ॱ(@NonNull String str);

        void ॱ(@NonNull String str, List<?> list);
    }

    static class b<T extends a> extends SubscriptionCallback {
        protected final T ˎ;

        public b(T t) {
            this.ˎ = t;
        }

        public void onChildrenLoaded(@NonNull String str, List<MediaItem> list) {
            this.ˎ.ॱ(str, list);
        }

        public void onError(@NonNull String str) {
            this.ˎ.ॱ(str);
        }
    }

    public static class c {
        public static int ॱ(Object obj) {
            return ((MediaItem) obj).getFlags();
        }

        public static Object ˊ(Object obj) {
            return ((MediaItem) obj).getDescription();
        }
    }

    static class e<T extends d> extends ConnectionCallback {
        protected final T ˊ;

        public e(T t) {
            this.ˊ = t;
        }

        public void onConnected() {
            this.ˊ.ॱ();
        }

        public void onConnectionSuspended() {
            this.ˊ.ˋ();
        }

        public void onConnectionFailed() {
            this.ˊ.ˊ();
        }
    }

    public static Object ˏ(d dVar) {
        return new e(dVar);
    }

    public static Object ˋ(Context context, ComponentName componentName, Object obj, Bundle bundle) {
        return new MediaBrowser(context, componentName, (ConnectionCallback) obj, bundle);
    }

    public static void ˎ(Object obj) {
        ((MediaBrowser) obj).connect();
    }

    public static void ॱ(Object obj) {
        ((MediaBrowser) obj).disconnect();
    }

    public static Bundle ˊ(Object obj) {
        return ((MediaBrowser) obj).getExtras();
    }

    public static Object ˋ(Object obj) {
        return ((MediaBrowser) obj).getSessionToken();
    }

    public static Object ˏ(a aVar) {
        return new b(aVar);
    }
}
